package com.rabbitmq.ChattingRoom.controller;

import com.rabbitmq.ChattingRoom.controller.biz.ChattingBiz;
import com.rabbitmq.ChattingRoom.util.common.base.Result;
import com.rabbitmq.ChattingRoom.util.common.req.SendMessageToQueueReq;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "chatting",produces = "application/json;charts=utf-8")
public class ChattingController {

    @Autowired
    private ChattingBiz biz;

    /**
     * 用户发送消息
     */
    @ApiOperation(value = "用户发送消息", notes = "用户向指定聊天室发送消息")
    @PostMapping(value = "sendMessage")
    public Result<String> sendMessage(@RequestBody SendMessageToQueueReq req){
        System.err.println("reqMsg:" + req);
        return biz.sendMessage(req);
    }

}
